package com.yuan.algorithms.practice201511;

import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author YouYuan
 * <br>E-mail:1265161633@qq.com
 * <br>创建时间：2015年11月21日 上午10:29:10
 * <br>说明:
 */
public class 计算N的阶乘 {

	static Scanner in = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
	public static void main(String[] args) {
		while(in.hasNext()) {
			int n = in.nextInt();
			if (n==0) {
				System.out.println(1);
				continue;
			}
			BigInteger a = new BigInteger(""+n);
			for (int i = 2; i < n; i++) {
				BigInteger b = new BigInteger(""+i);
				a = a.multiply(b);
			}
			out.println(a.toString());
			out.flush();
		}
	}

}
